<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateHomeUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('home_users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nickname', 255);
            $table->string('username', 255)->unique();
            $table->string('password', 255)->index();
            $table->tinyInteger('sex')->unsigned()->comment('1, 男 2，女 3，保密');
            $table->string('address', 255)->nullable();
            $table->char('code', 6)->nullable();
            $table->char('phone',11);
            $table->string('email', 255)->index();
            $table->timestamp('sign_time');
            $table->tinyInteger('user_level_id')->unsigned();
            $table->integer('user_score')->unsigned()->defautl(0);
            $table->tinyInteger('state')->comment('0:禁用, 1:启用');
            $table->string('attr1', 50)->nullable();
            $table->string('attr2', 100)->nullable();
            $table->string('attr3', 255)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('home_users');
    }
}
